package com.youlai.system.plugin.easyexcel;

import com.alibaba.excel.event.AnalysisEventListener;
import com.youlai.system.common.base.TaskInfo;

/**
 * 自定义解析结果监听器
 *
 * @author haoxr
 * @since 2023/03/01
 */
public abstract class MyAnalysisEventListener<T> extends AnalysisEventListener<T> {

    // 有效条数
    int validCount;

    // 无效条数
    int invalidCount;

    // 导入返回信息
    StringBuilder msg = new StringBuilder();

    public abstract String getMsg();

    public TaskInfo getTaskInfo() {
        TaskInfo taskInfo = new TaskInfo();
        taskInfo.setValidCount(validCount);
        taskInfo.setInvalidCount(invalidCount);
        taskInfo.setMsg(msg.toString());
        return taskInfo;
    }
}
